<?php

/**
 * lienetatdossier filter form base class.
 *
 * @package    e-DSL
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaselienetatdossierFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'dossier_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('dossier'), 'add_empty' => true)),
      'etat_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etat'), 'add_empty' => true)),
      'acteur_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('acteur'), 'add_empty' => true)),
      'personne_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('personne'), 'add_empty' => true)),
      'prestataire'         => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'nom_prestataire'     => new sfWidgetFormFilterInput(),
      'demandeur_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('demandeur'), 'add_empty' => true)),
      'commentaire'         => new sfWidgetFormFilterInput(),
      'readOnly'            => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'fermeTechnique'      => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'ferme'               => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'acteurpersonne_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('acteurpersonne'), 'add_empty' => true)),
      'ancienDateReference' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'dateReference'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'created_at'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'dossier_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('dossier'), 'column' => 'id')),
      'etat_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('etat'), 'column' => 'id')),
      'acteur_id'           => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('acteur'), 'column' => 'id')),
      'personne_id'         => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('personne'), 'column' => 'id')),
      'prestataire'         => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'nom_prestataire'     => new sfValidatorPass(array('required' => false)),
      'demandeur_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('demandeur'), 'column' => 'id')),
      'commentaire'         => new sfValidatorPass(array('required' => false)),
      'readOnly'            => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'fermeTechnique'      => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'ferme'               => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'acteurpersonne_id'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('acteurpersonne'), 'column' => 'id')),
      'ancienDateReference' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'dateReference'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'created_at'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('lienetatdossier_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'lienetatdossier';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'dossier_id'          => 'ForeignKey',
      'etat_id'             => 'ForeignKey',
      'acteur_id'           => 'ForeignKey',
      'personne_id'         => 'ForeignKey',
      'prestataire'         => 'Boolean',
      'nom_prestataire'     => 'Text',
      'demandeur_id'        => 'ForeignKey',
      'commentaire'         => 'Text',
      'readOnly'            => 'Boolean',
      'fermeTechnique'      => 'Boolean',
      'ferme'               => 'Boolean',
      'acteurpersonne_id'   => 'ForeignKey',
      'ancienDateReference' => 'Date',
      'dateReference'       => 'Date',
      'created_at'          => 'Date',
      'updated_at'          => 'Date',
    );
  }
}
